package org.qiyu.live.msg.provider.config;

import java.util.concurrent.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2023-10-01
 * Time: 19:42
 */
public class ThreadPoolManager {
    public static ThreadPoolExecutor commonAsyncPool = new
            ThreadPoolExecutor(2, 8, 3, TimeUnit.SECONDS, new
            ArrayBlockingQueue<>(1000)
            , new ThreadFactory() {
        @Override
        public Thread newThread(Runnable r) {
            Thread newThread = new Thread(r);
            newThread.setName(" commonAsyncPool - " +
                    ThreadLocalRandom.current().nextInt(10000));
            return newThread;
        }
    });
}